<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		
		#box{
			width: 200px;
			height: 200px;
			background: red url() 0 0 no-repeat;
		}
	</style>
	<script type="text/javascript">
		window.onload = function () {
			
			btn = document.getElementById('btn');

			box = document.getElementById('box');

			is_min = true;

			btn.onclick= function () {
				if(is_min){
					box.style.width="400px";
					is_min = false;
				}else{
					box.style.width="200px";
					is_min = true;
				}
			}

		}

	</script>
</head>
<body>
	<input type="button" id="btn" value="点我" name="">
	<div id="box"></div>
</body>
</html>